package com.itheima.health.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 体检预约信息
 */
@Table(name = "t_order")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Order implements Serializable{
    public static final String ORDERTYPE_TELEPHONE = "电话预约";
    public static final String ORDERTYPE_WEIXIN = "微信预约";
    public static final String ORDERSTATUS_WAIT = "待确认";
    //驳回原因
    public static final String ORDERSTATUS_reject = "驳回";
    public static final String ORDERSTATUS_YES = "待体检";
    public static final String UNREVIEWED ="未审核";
    public static final String REVIEWED = "已审核";
    public static final String REJECT ="已驳回";
    public static final String ORDERREPORT_YES="报告已上传";
    public static final String ORDERREPORT_NO="报告未上传";

    @Id
    @GeneratedValue(generator = "JDBC", strategy = GenerationType.IDENTITY)
    private Integer id;
    //会员id
    private Integer memberId;
    //预约日期
    @Column(name = "orderDate")
    @JSONField(format="yyyy-MM-dd")
    private Date orderDate;
    //预约类型 电话预约/微信预约
    @Column(name = "orderType")
    private String orderType;
    //预约状态（是否到诊）
    @Column(name = "orderStatus")
    private String orderStatus;
    //体检套餐id
    private Integer setmealId;
    @Column(name = "phoneNumber")
    private String phoneNumber;
    private String name;

    public Order(Integer id) {
        this.id = id;
    }

    public Order(Integer memberId, Date orderDate, String orderType, String orderStatus, Integer setmealId) {
        this.memberId = memberId;
        this.orderDate = orderDate;
        this.orderType = orderType;
        this.orderStatus = orderStatus;
        this.setmealId = setmealId;
    }

}
